package com.erp.remote.information;


import com.erp.entity.information.DeliveryAddress;
import com.erp.util.AjaxResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@RequestMapping("/information/deliveryAddress")
public interface DeliveryAddressRemote {

    @RequestMapping("/allDeliveryAddress")
    AjaxResult allDeliveryAddress();


    /**
     * 根据公司Id查询送货地址
     * @param companyId
     * @return
     */

    @RequestMapping("/selectDeliveryAddressByCompanyId")
    AjaxResult selectDeliveryAddressByCompanyId(@RequestParam("companyId") Integer companyId);


    /**
     * 根据公司Id分页查询送货地址
     * @param params
     * @return
     */
    @PostMapping("/selectDeliveryAddressByCompanyIdPage")
    AjaxResult selectDeliveryAddressByCompanyIdPage(@RequestBody Map<String, String> params);


    /**
     * 根据客户Id查询收获地址
     * @param clientId
     * @return
     */

    @PostMapping("/selectDeliveryAddressByClientId")
    AjaxResult selectDeliveryAddressByClientId(@RequestParam("clientId") Integer clientId);


    /**
     * 根据收货地址的简称，联系人，公司名称模糊查询收获地址
     * @param params
     * @return
     */
    @PostMapping("/getDeliveryAddressByDescription")
    AjaxResult getDeliveryAddressByDescription(@RequestBody Map<String,Object> params);

    /**
     * 添加收货地址数据
     * @param deliveryAddress
     * @return
     */
    @PostMapping("/addDeliveryAddress")
    AjaxResult addDeliveryAddress(@RequestBody DeliveryAddress deliveryAddress);

    /**
     * 添加时根据addressCode校验是否唯一
     * @param addressCode
     * @return
     */
    @RequestMapping("/checkDeliveryAddressOnly")
    AjaxResult checkDeliveryAddressOnly(@RequestParam("addressCode") String addressCode);


    /**
     * 修改收货地址数据
     * @param deliveryAddress
     * @return
     */
    @PostMapping("/updateDeliveryAddress")
    AjaxResult updateDeliveryAddress(@RequestBody DeliveryAddress deliveryAddress);
}
